﻿@model BLL.Model.OperatingSystem.OperatingSystemInfo
@{
    ViewBag.Title = "编辑操作系统信息";
    Layout = null;
}
<script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
<script type="text/javascript">
    $().ready(function () {
        var fieldset = $("fieldset");
        fieldset.find(":submit").button().click(function () {
            var form = $("#divOSInfo form");
            if (form.valid()) {
                var url = new Utility().getUrl("Add", "OS");
                $.post(url, form.serialize(), function (result) {
                    if (result == 'ok') {
                        alert("新增成功！");
                        $("#editDiv").data("dialog").close();
                    }
                });
            }
            return false;
        });
    });
</script>
<div id="divOSInfo">
    @using (Html.BeginForm("Add", "OperatingSystem"))
    {
        @Html.ValidationSummary(true)
        <fieldset style="text-align: left;">
            <legend>操作系统信息</legend>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Name, new { @class = "search_input" })
                @Html.ValidationMessageFor(model => model.Name)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Version)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Version, new { @class = "search_input" })
                @Html.ValidationMessageFor(model => model.Version)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Comment)
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(model => model.Comment, 5, 10, new { @class = "search_input" })
                @Html.ValidationMessageFor(model => model.Comment)
            </div>
            <p>
                <input type="submit" value="保 存" />
            </p>
        </fieldset>
    }
</div>
